package com.sky.controller.admin.shop;

import com.sky.result.Result;
import com.sky.service.ShopService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 42
 * @date 2025/3/28
 * @Description
 */
@RestController
@RequestMapping("/admin/shop")
@Slf4j
public class AdminShopController {

    @Autowired
    private ShopService shopService;

    /**
     * 设置店铺营业状态
     * @param status
     * @return
     */
    @PutMapping("/{status}")
    @ApiOperation( "设置店铺营业状态")
    public Result setShopStatus(@PathVariable Integer status){
        log.info("设置店铺营业状态:{}",status);
        return shopService.setShopStatus(status);
    }

    /**
     * 获取店铺营业状态
     * @return
     */
    @GetMapping("/status")
    @ApiOperation("获取店铺营业状态")
    public Result getShopStatus(){
        log.info("获取店铺营业状态");
        return shopService.getShopStatus();
    }

}
